package com.kinoshita.admin.service;

import com.kinoshita.admin.entity.SysPermission;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kinoshita.admin.api.domain.PermissionDO;
import com.kinoshita.admin.api.query.PermissionQueryDO;
import com.kinoshita.common.result.ResultDO;

/**
 * <p>
 *  权限管理
 * </p>
 *
 * @author reagan
 * @since 2022-08-29
 */
public interface IPermissionService extends IService<SysPermission> {

    /**
     * 添加权限
     * @param domain
     * @return ResultDO
     */
    public ResultDO add(PermissionDO domain);

    /**
     * 编辑权限
     * @param domain
     * @return ResultDO
     */
    public ResultDO edit(PermissionDO domain);

    /**
     * 删除权限
     * @param id
     * @return ResultDO
     */
    public ResultDO delete(Long id);

    /**
     * 获取权限
     * @param id
     * @return ResultDO
     */
    public ResultDO get(Long id);

    /**
     *  根据角色Id获取权限
     * @param roleId
     * @return ResultDO
     */
    public ResultDO getByRoleId(Long roleId);

    /**
     * 查询权限
     * @param query
     * @return ResultDO
     */
    public ResultDO query(PermissionQueryDO query);

}
